//
//  factory.swift
//  Victoria3
//
//  Created by lhc on 2023/11/1.
//

import Foundation

enum ProductionMode: String, CaseIterable {
case 工具伐木, 电力伐木, 一级硬木, 二级硬木,
     煤矿大气蒸汽机, 煤矿水管锅炉, 煤矿硝酸甘油, 煤矿黄色炸药, 柴油煤矿,
     铁矿大气蒸汽机, 铁矿水管锅炉, 铁矿硝酸甘油, 铁矿黄色炸药, 柴油铁矿,
     硫矿大气蒸汽机, 硫矿水管锅炉, 硫矿硝酸甘油, 硫矿黄色炸药, 柴油硫矿,
     铅矿大气蒸汽机, 铅矿水管锅炉, 铅矿硝酸甘油, 铅矿黄色炸药, 柴油铅矿,
     手工纺织, 染料纺织, 缝纫机纺织, 电动缝纫机纺织, 丝绸纺织, 橡胶纺织,
     手工家具, 车床家具, 机械化家具, 一级奢侈家具, 二级奢侈家具,
     手工玻璃, 含铅玻璃, 水晶玻璃, 塑料制玻璃, 一级瓷器, 二级瓷器,
     铁工具, 钢工具, 橡胶钢工具,
     手工造纸, 硫磺造纸, 染料造纸,
     集约农业肥料, 改良肥料, 固氮肥料,
     勒布朗炸药, 氨炸药, 真空炸药, 固氮炸药,
     泡钢, 贝塞麦, 平炉, 电弧,
     蒸汽火车头, 电力火车头, 柴油火车头, 汽车,
     简单农业, 集约农业, 肥料农业, 固氮农业,
     露天畜牧, 屠宰工具, 屠宰场, 机械化屠宰,
     奢侈饮品园, 奢侈饮品自动灌溉, 棉花, 棉花自动灌溉, 烟草, 烟草自动灌溉, 香蕉, 香蕉自动灌溉,
     捞鱼, 木船捞鱼, 铁船捞鱼,
     捕鲸, 木船捕鲸, 铁船捕鲸,
     蒸汽机采油, 内燃机采油,
     合成染料, 合成丝绸,
     面包房, 甜味剂, 发酵粉, 鱼罐头, 肉罐头, 糖制酒, 玻璃糖制酒,
     一级枪, 二级枪, 三级枪, 四级枪,
     一级炮, 二级炮, 三级炮, 四级炮,
     电话机, 无线电
        
    func raw() -> [(Int, Goods)] {
        switch self {
        case .工具伐木:
            return [(5, .tools)]
        case .电力伐木:
            return [(10, .tools), (5, .electricity)]
        case .一级硬木:
            return []
        case .二级硬木:
            return []
        case .煤矿大气蒸汽机:
            return [(10, .tools)]
        case .煤矿水管锅炉:
            return [(15, .tools)]
        case .煤矿硝酸甘油:
            return [(5, .explosive)]
        case .煤矿黄色炸药:
            return [(10, .explosive)]
        case .铁矿大气蒸汽机:
            return [(10, .tools), (10, .coal)]
        case .铁矿水管锅炉:
            return [(15, .tools), (15, .coal)]
        case .铁矿硝酸甘油:
            return [(5, .explosive)]
        case .铁矿黄色炸药:
            return [(10, .explosive)]
        case .硫矿大气蒸汽机:
            return [(10, .tools), (10, .coal)]
        case .硫矿水管锅炉:
            return [(15, .tools), (15, .coal)]
        case .硫矿硝酸甘油:
            return [(5, .explosive)]
        case .硫矿黄色炸药:
            return [(10, .explosive)]
        case .铅矿大气蒸汽机:
            return [(10, .tools), (10, .coal)]
        case .铅矿水管锅炉:
            return [(15, .tools), (15, .coal)]
        case .铅矿硝酸甘油:
            return [(5, .explosive)]
        case .铅矿黄色炸药:
            return [(10, .explosive)]
        case .柴油煤矿:
            return [(5, .oil), (15, .tools)]
        case .柴油铁矿:
            return [(5, .oil), (15, .tools)]
        case .柴油硫矿:
            return [(5, .oil), (15, .tools)]
        case .柴油铅矿:
            return [(5, .oil), (15, .tools)]
        case .手工纺织:
            return [(40, .fabric)]
        case .染料纺织:
            return [(40, .fabric), (5, .dye)]
        case .缝纫机纺织:
            return [(60, .fabric), (10, .dye), (5, .tools)]
        case .电动缝纫机纺织:
            return [(60, .fabric), (20, .dye), (10, .tools), (10, .electricity)]
        case .丝绸纺织:
            return [(-15, .fabric), (15, .silk)]
        case .橡胶纺织:
            return [(-35, .fabric), (30, .silk), (15, .rubber)]
        case .手工家具:
            return [(10, .fabric), (30, .wood)]
        case .车床家具:
            return [(10, .fabric), (30, .wood), (5, .tools)]
        case .机械化家具:
            return [(10, .fabric), (50, .wood), (10, .tools)]
        case .一级奢侈家具:
            return [(-15, .wood), (15, .hardwood)]
        case .二级奢侈家具:
            return [(-25, .wood), (25, .hardwood), (10, .tools)]
        case .手工玻璃:
            return [(30, .wood)]
        case .含铅玻璃:
            return [(20, .wood), (10, .lead)]
        case .水晶玻璃:
            return [(35, .lead)]
        case .塑料制玻璃:
            return [(30, .lead), (20, .oil)]
        case .一级瓷器:
            return [(5, .dye)]
        case .二级瓷器:
            return [(10, .dye)]
        case .铁工具:
            return [(30, .wood), (20, .iron)]
        case .钢工具:
            return [(30, .wood), (20, .steel)]
        case .橡胶钢工具:
            return [(20, .rubber), (30, .steel)]
        case .手工造纸:
            return [(30, .wood)]
        case .硫磺造纸:
            return [(30, .wood), (10, .sulfur)]
        case .染料造纸:
            return [(30, .wood), (10, .sulfur), (10, .dye)]
        case .集约农业肥料:
            return [(10, .iron), (30, .sulfur)]
        case .改良肥料:
            return [(30, .iron), (30, .sulfur)]
        case .固氮肥料:
            return [(30, .iron), (40, .sulfur), (20, .oil)]
        case .勒布朗炸药:
            return [(20, .fertilizer), (20, .sulfur)]
        case .氨炸药:
            return [(30, .fertilizer), (30, .sulfur), (10, .paper)]
        case .真空炸药:
            return [(40, .fertilizer), (40, .sulfur), (20, .paper)]
        case .固氮炸药:
            return [(50, .fertilizer), (40, .sulfur), (30, .paper), (20, .electricity)]
        case .泡钢:
            return [(30, .coal), (40, .iron)]
        case .贝塞麦:
            return [(30, .coal), (60, .iron)]
        case .平炉:
            return [(30, .coal), (90, .iron)]
        case .电弧:
            return [(30, .coal), (100, .iron), (30, .electricity)]
        case .蒸汽火车头:
            return [(30, .steel)]
        case .电力火车头:
            return [(40, .steel), (30, .electricity)]
        case .柴油火车头:
            return [(50, .steel), (50, .oil)]
        case .汽车:
            return [(10, .rubber), (10, .oil)]
        case .简单农业:
            return []
        case .集约农业:
            return [(5, .fertilizer)]
        case .肥料农业:
            return [(15, .fertilizer)]
        case .固氮农业:
            return [(40, .fertilizer)]
        case .露天畜牧:
            return []
        case .屠宰工具:
            return [(5, .tools)]
        case .屠宰场:
            return [(10, .tools)]
        case .机械化屠宰:
            return [(10, .tools), (5, .coal)]
        case .棉花:
            return []
        case .棉花自动灌溉:
            return [(5, .engines)]
        case .烟草:
            return []
        case .烟草自动灌溉:
            return [(5, .engines)]
        case .香蕉:
            return []
        case .香蕉自动灌溉:
            return [(5, .engines)]
        case .奢侈饮品园:
            return []
        case .奢侈饮品自动灌溉:
            return [(5, .engines)]
        case .捞鱼:
            return []
        case .木船捞鱼:
            return [(5, .boat)]
        case .铁船捞鱼:
            return [(5, .ship), (15, .coal)]
        case .捕鲸:
            return []
        case .木船捕鲸:
            return [(5, .boat)]
        case .铁船捕鲸:
            return [(5, .ship), (20, .coal)]
        case .蒸汽机采油:
            return [(5, .engines), (10, .coal)]
        case .内燃机采油:
            return [(10, .engines)]
        case .合成染料:
            return [(30, .fertilizer), (20, .sulfur)]
        case .合成丝绸:
            return [(10, .wood)]
        case .面包房:
            return [(40, .grain)]
        case .甜味剂:
            return [(40, .grain), (15, .meat)]
        case .发酵粉:
            return [(80, .grain), (30, .meat)]
        case .鱼罐头:
            return [(10, .grain), (10, .iron)]
        case .肉罐头:
            return [(10, .iron), (20, .meat), (5, .oil)]
        case .糖制酒:
            return [(25, .meat)]
        case .玻璃糖制酒:
            return [(25, .meat), (10, .glass)]
        case .一级枪:
            return [(10, .iron), (10, .hardwood)]
        case .二级枪:
            return [(10, .steel), (10, .hardwood), (5, .tools)]
        case .三级枪:
            return [(20, .steel), (10, .hardwood), (10, .tools)]
        case .四级枪:
            return [(20, .steel), (10, .hardwood), (20, .tools), (10, .oil)]
        case .一级炮:
            return [(15, .iron), (10, .hardwood)]
        case .二级炮:
            return [(25, .iron), (15, .hardwood)]
        case .三级炮:
            return [(25, .steel), (10, .tools), (10, .hardwood)]
        case .四级炮:
            return [(10, .oil), (20, .tools), (40, .steel)]
        case .电话机:
            return [(20, .iron), (20, .lead), (10, .tools), (20, .rubber)]
        case .无线电:
            return [(50, .electricity)]
        }
    }
    
    func process() -> [(Int, Goods)] {
        switch self {
        case .工具伐木:
            return [(60, .wood)]
        case .电力伐木:
            return [(100, .wood)]
        case .一级硬木:
            return [(-30, .wood), (20, .hardwood)]
        case .二级硬木:
            return [(-50, .wood), (40, .hardwood)]
        case .煤矿大气蒸汽机:
            return [(40, .coal)]
        case .煤矿水管锅炉:
            return [(60, .coal)]
        case .煤矿硝酸甘油:
            return [(15, .coal)]
        case .煤矿黄色炸药:
            return [(25, .coal)]
        case .铁矿大气蒸汽机:
            return [(40, .iron)]
        case .铁矿水管锅炉:
            return [(60, .iron)]
        case .铁矿硝酸甘油:
            return [(12, .iron)]
        case .铁矿黄色炸药:
            return [(20, .iron)]
        case .硫矿大气蒸汽机:
            return [(40, .sulfur)]
        case .硫矿水管锅炉:
            return [(60, .sulfur)]
        case .硫矿硝酸甘油:
            return [(10, .sulfur)]
        case .硫矿黄色炸药:
            return [(20, .sulfur)]
        case .铅矿大气蒸汽机:
            return [(40, .lead)]
        case .铅矿水管锅炉:
            return [(60, .lead)]
        case .铅矿硝酸甘油:
            return [(12, .lead)]
        case .铅矿黄色炸药:
            return [(20, .lead)]
        case .柴油煤矿:
            return [(90, .coal)]
        case .柴油铁矿:
            return [(70, .iron)]
        case .柴油硫矿:
            return [(80, .sulfur)]
        case .柴油铅矿:
            return [(70, .lead)]
        case .手工纺织:
            return [(45, .clothes)]
        case .染料纺织:
            return [(60, .clothes)]
        case .缝纫机纺织:
            return [(100, .clothes)]
        case .电动缝纫机纺织:
            return [(140, .clothes)]
        case .丝绸纺织:
            return [(-30, .clothes), (30, .luxury)]
        case .橡胶纺织:
            return [(-70, .clothes), (70, .luxury)]
        case .手工家具:
            return [(45, .furniture)]
        case .车床家具:
            return [(65, .furniture)]
        case .机械化家具:
            return [(110, .furniture)]
        case .一级奢侈家具:
            return [(-25, .furniture), (25, .luxury)]
        case .二级奢侈家具:
            return [(-55, .furniture), (55, .luxury)]
        case .手工玻璃:
            return [(30, .glass)]
        case .含铅玻璃:
            return [(40, .glass)]
        case .水晶玻璃:
            return [(60, .glass)]
        case .塑料制玻璃:
            return [(100, .glass)]
        case .一级瓷器:
            return [(-10, .glass), (10, .porcelain)]
        case .二级瓷器:
            return [(-20, .glass), (30, .porcelain)]
        case .铁工具:
            return [(60, .tools)]
        case .钢工具:
            return [(80, .tools)]
        case .橡胶钢工具:
            return [(120, .tools)]
        case .手工造纸:
            return [(40, .paper)]
        case .硫磺造纸:
            return [(70, .paper)]
        case .染料造纸:
            return [(100, .paper)]
        case .集约农业肥料:
            return [(90, .fertilizer)]
        case .改良肥料:
            return [(140, .fertilizer)]
        case .固氮肥料:
            return [(200, .fertilizer)]
        case .勒布朗炸药:
            return [(50, .explosive)]
        case .氨炸药:
            return [(80, .explosive)]
        case .真空炸药:
            return [(110, .explosive)]
        case .固氮炸药:
            return [(150, .explosive)]
        case .泡钢:
            return [(65, .steel)]
        case .贝塞麦:
            return [(90, .steel)]
        case .平炉:
            return [(120, .steel)]
        case .电弧:
            return [(150, .steel)]
        case .蒸汽火车头:
            return [(40, .engines)]
        case .电力火车头:
            return [(80, .engines)]
        case .柴油火车头:
            return [(120, .engines)]
        case .汽车:
            return [(-20, .engines), (30, .car)]
        case .简单农业:
            return [(20, .grain)]
        case .集约农业:
            return [(40, .grain)]
        case .肥料农业:
            return [(80, .grain)]
        case .固氮农业:
            return [(120, .grain)]
        case .露天畜牧:
            return [(10, .meat)]
        case .屠宰工具:
            return [(20, .meat)]
        case .屠宰场:
            return [(30, .meat)]
        case .机械化屠宰:
            return [(45, .meat)]
        case .棉花:
            return [(40, .fabric)]
        case .棉花自动灌溉:
            return [(100, .fabric)]
        case .烟草:
            return [(25, .tobacco)]
        case .烟草自动灌溉:
            return [(50, .tobacco)]
        case .香蕉:
            return [(30, .banana)]
        case .香蕉自动灌溉:
            return [(60, .banana)]
        case .奢侈饮品园:
            return [(20, .beverage)]
        case .奢侈饮品自动灌溉:
            return [(40, .beverage)]
        case .捞鱼:
            return [(25, .grain)]
        case .木船捞鱼:
            return [(50, .grain)]
        case .铁船捞鱼:
            return [(100, .grain)]
        case .捕鲸:
            return [(10, .oil), (5, .meat)]
        case .木船捕鲸:
            return [(20, .oil), (10, .meat)]
        case .铁船捕鲸:
            return [(40, .oil), (20, .meat)]
        case .蒸汽机采油:
            return [(60, .oil)]
        case .内燃机采油:
            return [(100, .oil)]
        case .合成染料:
            return [(80, .dye)]
        case .合成丝绸:
            return [(-10, .dye), (30, .silk)]
        case .面包房:
            return [(45, .processedFood)]
        case .甜味剂:
            return [(65, .processedFood)]
        case .发酵粉:
            return [(120, .processedFood)]
        case .鱼罐头:
            return [(30, .processedFood)]
        case .肉罐头:
            return [(60, .processedFood)]
        case .糖制酒:
            return [(-30, .processedFood), (60, .alcohol)]
        case .玻璃糖制酒:
            return [(-40, .processedFood), (100, .alcohol)]
        case .一级枪:
            return [(30, .gun)]
        case .二级枪:
            return [(50, .gun)]
        case .三级枪:
            return [(70, .gun)]
        case .四级枪:
            return [(100, .gun)]
        case .一级炮:
            return [(25, .bigGun)]
        case .二级炮:
            return [(45, .bigGun)]
        case .三级炮:
            return [(65, .bigGun)]
        case .四级炮:
            return [(90, .bigGun)]
        case .电话机:
            return [(60, .phone)]
        case .无线电:
            return [(-20, .phone), (40, .radio)]
        }
    }
    
}
